# -*- coding: utf-8 -*-


class User(object):
    """用户实体类，保存用户信息"""
    def __init__(self, username, win, lose, tie, score):
        self._username = username
        self._win = win
        self._lose = lose
        self._tie = tie
        self._score = score

    @property
    def username(self):
        return self._username

    @property
    def win(self):
        return self._win

    @property
    def lose(self):
        return self._lose

    @property
    def tie(self):
        return self._tie

    @property
    def score(self):
        return self._score

    @win.setter
    def win(self, win):
        self._win = win

    @lose.setter
    def lose(self, lose):
        self._lose = lose

    @tie.setter
    def tie(self, tie):
        self._tie = tie

    @score.setter
    def score(self, score):
        self._score = score

    def __str__(self):
        return "username = %s, win = %d, lose = %d, tie = %d, score = %d" % (self._username, self._win,
                                                                             self._lose, self._tie, self._score)

